package com.qwert.shortlink.project.service;

import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;

import java.io.IOException;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2024/7/5 18:15
 **/
public interface RedirectLinkService {

    /**
     * 短链接跳转
     * @param shortLinkUri 短链接uri
     * @param request 请求
     * @param response 响应
     * @throws IOException 抛出异常
     */
    void redirectLink(String shortLinkUri, ServletRequest request, ServletResponse response) throws IOException;

    /**
     * 获取目的url的title
     * @param aimUrl 目的url
     * @return 目的url的标题
     */
    String getTitleByUrl(String aimUrl);
}
